import React, { Component } from 'react'

export default class VoteFooter extends Component {
    render() {
        return (
            <div>
                <button onClick={()=>this.handler(0)}>支持</button>
                <button onClick={()=>this.handler(1)}>反对</button>
            </div>
        )
    }
    handler = type => {
        console.log(type)
        const { store } = this.props
        if(type === 0 ){
            store.dispatch({
                type: 'SUPPORT',
                payload: 10
            })
            return
        }
        store.dispatch({
            type: 'OPPOSE',
            payload: 5
        })
    }
}
